package es.tid.android.copiagenda;

import java.util.List;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

public class TestCopiagenda extends Activity {
	
	public void onCreate(Bundle icicle) {
		super.onCreate(icicle);
		TextView view = new TextView(this);
		view.setText("Starting HttpsClient Copyagenda  tests\n");
		setContentView(view);
		
		try {
			run(view);
		} catch (Exception ex) {
			
		} 
	}

	public void run(TextView view) {
		try {
			Log.i ("CopyAgenda", "Empiezo ...");
			Copiagenda oCopiagenda = new Copiagenda(this.getAssets());
			
			List<String> contactList = oCopiagenda.RetrieveContacts("618956040", "123456789");

			for (String contact:contactList) {
				view.append("Contact: " + contact + "\n");
			}
		} catch (Exception ex) {
			view.append("Error Contact Failed \n");
			Log.e ("TestHttpsClient", "Error: ", ex);
		}
		
		Log.i ("CopyAgenda", "Fin ...");
	}

}